package org.jeecg.modules.wms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 入库单明细
 */
@Data
@TableName("wms_inbound_order_detail")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="wms_inbound_order_detail对象", description="入库单明细")
public class WmsInboundOrderDetail implements Serializable {
    private static final long serialVersionUID = 1L;

    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    
    /**入库单ID*/
    @Excel(name = "入库单ID", width = 15)
    @ApiModelProperty(value = "入库单ID")
    private String inboundOrderId;
    
    /**物料ID*/
    @Excel(name = "物料ID", width = 15)
    @ApiModelProperty(value = "物料ID")
    private String materialId;
    
    /**物料编码*/
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String materialCode;
    
    /**物料名称*/
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String materialName;

    /**物料系列 */
    @Excel(name = "物料系列", width = 15)
    @ApiModelProperty(value = "物料系列")
    private String materialSeries;
    
    /**物料类型*/
    @Excel(name = "物料类型", width = 15)
    @ApiModelProperty(value = "物料类型")
    @Dict(dicCode = "material_type")
    private String materialType;
    
    /**规格型号*/
    @Excel(name = "规格型号", width = 15)
    @ApiModelProperty(value = "规格型号")
    private String specification;
    
    /**颜色*/
    @Excel(name = "颜色", width = 15)
    @ApiModelProperty(value = "颜色")
    private String color;

    /**
     * 物料长度  仅余料
     */
    @Excel(name = "物料长度", width = 15)
    @ApiModelProperty(value = "物料长度")
    private BigDecimal materialLength;

    /**单位*/
    @Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    private String unit;
    
    /**计划入库仓库ID*/
    @Excel(name = "计划入库仓库ID", width = 15)
    @ApiModelProperty(value = "计划入库仓库ID")
    private String planWarehouseId;
    
    /**计划入库仓库名称*/
    @Excel(name = "计划入库仓库名称", width = 15)
    @ApiModelProperty(value = "计划入库仓库名称")
    private String planWarehouseName;
    
    /**计划入库库位ID*/
    @Excel(name = "计划入库库位ID", width = 15)
    @ApiModelProperty(value = "计划入库库位ID")
    private String planLocationId;
    
    /**计划入库库位名称*/
    @Excel(name = "计划入库库位名称", width = 15)
    @ApiModelProperty(value = "计划入库库位名称")
    private String planLocationName;
    
    /**计划入库数量*/
    @Excel(name = "计划入库数量", width = 15)
    @ApiModelProperty(value = "计划入库数量")
    private BigDecimal planQuantity;
    
    /**实际入库仓库ID*/
    @Excel(name = "实际入库仓库ID", width = 15)
    @ApiModelProperty(value = "实际入库仓库ID")
    private String actualWarehouseId;
    
    /**实际入库仓库名称*/
    @Excel(name = "实际入库仓库名称", width = 15)
    @ApiModelProperty(value = "实际入库仓库名称")
    private String actualWarehouseName;
    
    /**实际入库库位ID*/
    @Excel(name = "实际入库库位ID", width = 15)
    @ApiModelProperty(value = "实际入库库位ID")
    private String actualLocationId;
    
    /**实际入库库位名称*/
    @Excel(name = "实际入库库位名称", width = 15)
    @ApiModelProperty(value = "实际入库库位名称")
    private String actualLocationName;
    
    /**实际入库数量*/
    @Excel(name = "实际入库数量", width = 15)
    @ApiModelProperty(value = "实际入库数量")
    private BigDecimal actualQuantity;
    
    /**单位成本*/
    @Excel(name = "单位成本", width = 15)
    @ApiModelProperty(value = "单位成本")
    private BigDecimal unitCost;
    
    /**总成本*/
    @Excel(name = "总成本", width = 15)
    @ApiModelProperty(value = "总成本")
    private BigDecimal totalCost;
    
    /**上限*/
    @Excel(name = "上限", width = 15)
    @ApiModelProperty(value = "上限")
    private BigDecimal upperLimit;
    
    /**下限*/
    @Excel(name = "下限", width = 15)
    @ApiModelProperty(value = "下限")
    private BigDecimal lowerLimit;
    
    /**排序*/
    @Excel(name = "排序", width = 15)
    @ApiModelProperty(value = "排序")
    private Integer sortNo;
    
    /**库位状态*/
    @Excel(name = "库位状态", width = 15)
    @ApiModelProperty(value = "库位状态")
    @Dict(dicCode = "location_status")
    @TableField(exist = false)
    private String locationStatus;
    
    /**是否库位已满*/
    @Excel(name = "是否库位已满", width = 15)
    @ApiModelProperty(value = "是否库位已满")
    @TableField(exist = false)
    private Boolean locationFull;
    
    /**是否额外库位*/
    @Excel(name = "是否额外库位", width = 15)
    @ApiModelProperty(value = "是否额外库位")
    @TableField(exist = false)
    private Boolean isExtra;
    
    /**原始明细ID*/
    @Excel(name = "原始明细ID", width = 15)
    @ApiModelProperty(value = "原始明细ID")
    private String originalDetailId;
    
    /**源仓库ID*/
    @Excel(name = "源仓库ID", width = 15)
    @ApiModelProperty(value = "源仓库ID")
    private String sourceWarehouseId;
    
    /**源仓库名称*/
    @Excel(name = "源仓库名称", width = 15)
    @ApiModelProperty(value = "源仓库名称")
    private String sourceWarehouseName;
    
    /**源库位ID*/
    @Excel(name = "源库位ID", width = 15)
    @ApiModelProperty(value = "源库位ID")
    private String sourceLocationId;
    
    /**源库位名称*/
    @Excel(name = "源库位名称", width = 15)
    @ApiModelProperty(value = "源库位名称")
    private String sourceLocationName;
    
    /**批次号*/
    @Excel(name = "批次号", width = 15)
    @ApiModelProperty(value = "批次号")
    private String batchNo;
    
    /**备注*/
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    
    /**更新时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    
    /**入库状态*/
    @ApiModelProperty(value = "入库状态")
    private String inboundStatus;
    
    /**是否余料*/
    @Excel(name = "是否余料", width = 15)
    @ApiModelProperty(value = "是否余料")
    private Boolean isSurplus;
    
    /**是否更新库存信息*/
    @TableField(exist = false)
    @ApiModelProperty(value = "是否更新库存信息")
    private Boolean updateInventory;

    @TableField(exist = false)
    private boolean updateLocationStatus;

    /**
     * 获取是否更新库位状态
     * @return 是否更新库位状态
     */
    public Boolean getUpdateLocationStatus() {
        return this.updateLocationStatus;
    }
    
    /**
     * 设置是否更新库位状态
     * @param updateLocationStatus 是否更新库位状态
     */
    public void setUpdateLocationStatus(Boolean updateLocationStatus) {
        this.updateLocationStatus = updateLocationStatus != null ? updateLocationStatus : false;
    }

    @TableField(exist = false)
    private String materialTypeName;
}